import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { cameraAiVO, cameraAiForm, cameraAiQuery } from '@/api/camera/camera-ai/types';

/**
 * 查询摄像头ai算法列表
 * @param query
 * @returns {*}
 */

export const listcameraAi = (query?: cameraAiQuery): AxiosPromise<cameraAiVO[]> => {
  return request({
    url: '/camera/camera-ai/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询摄像头ai算法详细
 * @param cameraAiId
 */
export const getcameraAi = (cameraAiId: string | number): AxiosPromise<cameraAiVO> => {
  return request({
    url: '/camera/camera-ai/' + cameraAiId,
    method: 'get'
  });
};

/**
 * 新增摄像头ai算法
 * @param data
 */
export const addcameraAi = (data: cameraAiForm) => {
  return request({
    url: '/camera/camera-ai',
    method: 'post',
    data: data
  });
};

/**
 * 修改摄像头ai算法
 * @param data
 */
export const updatecameraAi = (data: cameraAiForm) => {
  return request({
    url: '/camera/camera-ai',
    method: 'put',
    data: data
  });
};

/**
 * 删除摄像头ai算法
 * @param cameraAiId
 */
export const delcameraAi = (cameraAiId: string | number | Array<string | number>) => {
  return request({
    url: '/camera/camera-ai/' + cameraAiId,
    method: 'delete'
  });
};
